home *** CD-ROM | disk | FTP | other *** search
- /*
- File: ExpansionBus.h
-
- Contains: Expansion Mgr Device Tree Manipulation Routines
-
- Written by: Al Kossow
-
- Copyright: © 1993-1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <1> 3/31/94 fau first checked in
- */
-
- #pragma once
- #ifndef __EXPANSIONBUS__
- #define __EXPANSIONBUS__
-
- #ifndef __TYPES__
- #include "Types.h"
- #endif
-
- // for sIntQElemPtr
- #ifndef __OSUTILS__
- #include <OSUtils.h>
- #endif
-
- #define kTypeMask 0x03
- #define kDeviceNode 0x01
- #define kPropertyNode 0x02
-
- #define kNullAttribute 0
- #define kAttributeMask 0x70
- #define kAttributeLocked 0x10
- #define kAttributeNVRAM 0x20
- #define kAttributeSystem 0x40
-
- #define kAttributeROMProperty 0x80
- #define kAttributeDeferred 0x100
-
- /*
- * The device tree types
- */
-
- typedef void *DeviceTreeNodeID;
- typedef DeviceTreeNodeID DeviceNodeID;
- typedef DeviceTreeNodeID DevicePropertyID;
-
- /*
- * The device tree info structures
- */
-
- typedef struct DeviceNodeInfo {
- unsigned long nodeAttributes; // attributes of this node
- DeviceNodeID parentNode; // cannot be nil, except for the root
- DeviceNodeID peerNode; // nil if no peers
- DeviceNodeID childNode;
- DevicePropertyID propertyNode;
- char name[32]; // name of this node
- } DeviceNodeInfo;
-
- typedef struct DevicePropertyInfo {
- unsigned long nodeAttributes; // attributes of this node
- DeviceNodeID parentNode; // cannot be nil
- DevicePropertyID peerNode; // nil if no peers
- unsigned long propertySize; // size of property
- char name[32]; // name of this node
- } DevicePropertyInfo;
-
- #ifndef _ExpansionBusDispatch
- #define _ExpansionBusDispatch 0xAAF3
- #endif
-
- /*
- * Expansion Manager C Interface
- *
- */
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- // Selectors are in D0.W, with the low byte containing the actual selector
- // and the high byte containing the number of words of parameters on the
- // stack.
-
- OSErr DeviceTreeRoot (DeviceNodeID *rootNode)
- = { 0x303c, 0x0204, _ExpansionBusDispatch};
-
- OSErr DeviceTreeDeviceInfo (DeviceNodeID nodeID, DeviceNodeInfo *nodeInfo)
- = { 0x303c, 0x0405, _ExpansionBusDispatch};
-
- OSErr DeviceTreePropertyInfo (DevicePropertyID nodeID, DevicePropertyInfo *nodeInfo)
- = { 0x303c, 0x0406, _ExpansionBusDispatch};
-
- OSErr DeviceTreePeerCount (DeviceNodeID nodeID, unsigned long *count)
- = { 0x303c, 0x040D, _ExpansionBusDispatch};
-
- OSErr DeviceTreePropertyCount (DeviceNodeID nodeID, unsigned long *count)
- = { 0x303c, 0x040E, _ExpansionBusDispatch};
-
- OSErr DeviceTreeSearch (DeviceNodeID *startNodeID, Byte *targetProperty,
- Byte *propertyValue, Boolean restartSearch)
- = { 0x303c, 0x0707, _ExpansionBusDispatch};
-
- OSErr DeviceTreeNodeSearch (DeviceNodeID nodeID, Byte *targetProperty,
- Byte *propertyData, unsigned long maxSize,
- unsigned long *actualSize)
- = { 0x303c, 0x0A08, _ExpansionBusDispatch};
-
- OSErr DeviceTreeAddDevice (DeviceNodeID parentNodeID, unsigned long attributes,
- Byte *name, DeviceNodeID *newNode)
- = { 0x303c, 0x0809, _ExpansionBusDispatch};
-
- OSErr DeviceTreeDeleteDevice (DeviceNodeID nodeID)
- = { 0x303c, 0x020A, _ExpansionBusDispatch};
-
- OSErr DeviceTreeAddProperty (DeviceNodeID parentNodeID, unsigned long attributes,
- Byte *name, DevicePropertyID *newNode)
- = { 0x303c, 0x080B, _ExpansionBusDispatch};
-
- OSErr DeviceTreeDeleteProperty (DevicePropertyID nodeID)
- = { 0x303c, 0x020C, _ExpansionBusDispatch};
-
- OSErr DeviceTreeSetProperty (DevicePropertyID nodeID, Byte *userData,
- unsigned long size)
- = { 0x303c, 0x060F, _ExpansionBusDispatch};
-
- OSErr DeviceTreeGetProperty (DevicePropertyID nodeID, Byte *userData,
- unsigned long size)
- = { 0x303c, 0x0610, _ExpansionBusDispatch};
-
- OSErr ExpMgrRegisterBridge (DeviceNodeID nodeID)
- = { 0x303c, 0x0211, _ExpansionBusDispatch};
-
- OSErr ExpMgrEnableBridge (DeviceNodeID nodeID)
- = { 0x303c, 0x0212, _ExpansionBusDispatch};
-
- OSErr ExpMgrDisableBridge (DeviceNodeID nodeID)
- = { 0x303c, 0x0213, _ExpansionBusDispatch};
-
- OSErr ExpMgrInstallISR (QElemPtr sIntQElemPtr, DeviceNodeID nodeID)
- = { 0x303c, 0x0400, _ExpansionBusDispatch};
-
- OSErr ExpMgrRemoveISR (QElemPtr sIntQElemPtr, DeviceNodeID nodeID)
- = { 0x303c, 0x0401, _ExpansionBusDispatch};
-
- OSErr ExpMgrInstallVBL (QElemPtr sIntQElemPtr, DeviceNodeID nodeID)
- = { 0x303c, 0x0402, _ExpansionBusDispatch};
-
- OSErr ExpMgrRemoveVBL (QElemPtr sIntQElemPtr, DeviceNodeID nodeID)
- = { 0x303c, 0x0403, _ExpansionBusDispatch};
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif
-